<template>
  <div  class="app-container">
    <el-card style="margin-bottom: 20px">
      <el-row>
        <el-col :span="3">
          <el-image style="width: 100%; height: 100%" :src="owner.avatar" fit="['fill', 'contain', 'cover', 'none', 'scale-down']"></el-image>
        </el-col>
        <el-col :span="21">
          <el-row style="padding-left: 10px;padding-right: 50px;padding-bottom: 40px">
            <el-col :span="6">
              <span class="zitiyangshi">业主ID:</span> <span class="neirong">{{owner.id}}</span>
            </el-col>
            <el-col :span="6">
              <span class="zitiyangshi">业主名称:</span> <span class="neirong">{{ owner.name }}</span>
            </el-col>
            <el-col :span="6">
              <span class="zitiyangshi">性别:</span> <span class="neirong">{{ owner.sex===1 ? '男':'女' }}</span>
            </el-col>
            <el-col :span="6">
              <span class="zitiyangshi">年龄:</span> <span class="neirong">{{ owner.age }}</span> 岁
            </el-col>
          </el-row>
          <el-row style="padding-left: 10px;padding-right: 50px;">
            <el-col :span="6">
              <span class="zitiyangshi">手机号:</span> <span class="neirong">{{ owner.link | phone}}</span>
            </el-col>
            <el-col :span="6">
              <span class="zitiyangshi">身份证号:</span> <span class="neirong">{{ owner.idCard |idCard }}</span>
            </el-col>
            <el-col :span="6">
              <span class="zitiyangshi">备注:</span> <span class="neirong">{{ owner.remark }}</span>
            </el-col>
            <el-col :span="6">
              <span class="zitiyangshi">业主注册时间:</span> <span class="neirong">{{ owner.createTime}}</span>
            </el-col>
          </el-row>
        </el-col>
      </el-row>
    </el-card>
    <UnitList :ownerId="ownerId" :num="$route.params.num"/>
  </div>
</template>

<script>
import {getFloorRoom} from '@/api/village/floor'

import UnitList from '../ownerDetails/unitList'
import {getOwnerById} from "@/api/village/owner";


export default {
  name: "ownerDetails",
  components: {UnitList},
  data(){
    return{
      ownerId:this.$route.params.id,
      owner:{}
    }
  },
  created() {
    this.getOwner()
  },
  methods:{
    getOwner(){
      getOwnerById(this.ownerId).then(res => {
        this.owner = res.data
      })
    }
  }

}
</script>

<style scoped>

</style>
